﻿using MengCC.Core.Data;
using System;
using System.Collections.Generic;
using System.Text;

namespace MengCC.Core.Projects
{
    public class BuildLog : BaseEntity<string>
    {
        /// <summary>
        /// 构建项目
        /// </summary>
        public int ProjectId { get; set; }
        /// <summary>
        /// 项目名称
        /// </summary>
        public string ProjectName { get; set; }
        /// <summary>
        /// 构建时间
        /// </summary>
        public DateTime BuildTime { get; set; }
        /// <summary>
        /// 构建完成时间
        /// </summary>
        public DateTime BuildedTime { get; set; }
        /// <summary>
        /// 构建状态
        /// </summary>
        public BuildStateEnum BuildState { get; set; }
        /// <summary>
        /// 输出内容
        /// </summary>
        public string OutContent { get; set; }
        /// <summary>
        /// 构建编号
        /// </summary>
        public int BuildNum { get; set; }

        public enum BuildStateEnum
        {
            /// <summary>
            /// 正在构建
            /// </summary>
            Building,
            /// <summary>
            /// 构建成功
            /// </summary>
            Successed,
            /// <summary>
            /// 构建失败
            /// </summary>
            Failed
        }

        public string GetIOKey()
        {
            return $"{ProjectId}-{Id}";
        }
    }
}
